/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PropertyRental.war.servlets;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Bast
 */
class DeleteUserAction extends Action {

    public DeleteUserAction (String success, String fail){
        super(success, fail);
    }

    @Override
    public String perform(HttpServletRequest req) {
        HttpSession session = req.getSession();

        synchronized(session) {
            session.setAttribute("account",null);
            session.invalidate();
        }
        loginEJB.delete();

        return this.getSuccesspage();
    }

}
